<style>
    .notselect{display: none}
    .layui-body{position: inherit !important;margin: 0 !important;padding: 0 !important;}
</style>
<div class="layui-tab layui-tab-card think-bg-white">
<div class="layui-tab-content">
    {include file='control/storehouse_data/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>配件编号</th>
            <th class='text-left nowrap'>配件名称</th>
            <th class='text-left nowrap'>型号/规格</th>
            <th class='text-left nowrap'>单位</th>
            <th class='text-left nowrap'>单价</th>
            <th class='list-table-sort-td'>数量</th>
            <th class='text-left nowrap'>小计</th>
            <th class='list-table-sort-td'>领用数量</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo|json_encode}' type='checkbox'>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>编号：<span>{$vo.material_code|default='--'}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>名称：<span>{$vo.material_name|default='--'}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>规格：<span>{$vo.material_model|default='--'}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>单位：<span>{$vo.material_unit|default='--'}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>单价：<span>{$vo.material_price|default='--'}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>数量：<span>{$vo.material_num|default='--'}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <div>小计：<span>{$vo.material_price * $vo.material_num}</span></div>
                </div>
            </td>
            <td class='nowrap'>
                <div class="inline-block text-top sub-span-blue">
                    <input style="width: 60px;text-align: center;" class="layui-input" type="text" value="0">
                </div>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
    <script>
        //获取选中数据
        function getCheckd(){
            var ids = [];
            $(".list-check-box:checked").each(function(i){
                var info = $(this).val()
                console.log(info)
                // var injson = JSON.parse(info);
                ids.push(info)
            })
            return ids;
        }
        layui.use('table', function(){
            var table = layui.table;
            
            //监听表格复选框选择
            table.on('checkbox(demo)', function(obj){
                console.log(obj)
            });

        });
    </script>
</div>
<script>form.render()</script>